<extend name="./Common/View/Public/list.html" />

<block name="page_title">项目列表</block>
<block name="search">
    <div class="layui-input-inline">
        <select name="tpl_id" id="tpl_id" lay-filter="tpl_id" api="rate/Template/slist" empty="模板"></select>
    </div>
    <div class="layui-input-inline">
        <select name="status" id="status" lay-filter="status" api="sys/Dict/info/code/STATUS" empty="状态"></select>
    </div>
    <div class="layui-input-inline">
                <input class="layui-input" name="keywords" autocomplete="off" placeholder="名称" />
    </div>
</block>

<block name="toolbar">
    {:W('Todo/UI/toolbar',array('项目',array('add','delete','enable','disable')))}
</block>

<block name="main">
    <script type="text/javascript">
        var list = {api:"{$Think.const.MODULE_NAME}/{$Think.const.CONTROLLER_NAME}/"};
        list.columns =  [[
            {checkbox: true, fixed: true}
            , {field:'title', minWidth:100, title : '项目名称'}
            , {field:'tpl_id', minWidth:150, title : '使用模板', sort: true, templet: '#tpl_template'}
            , {field:'start_time', minWidth:150, title : '开始时间', sort: true, templet: '#tpl_start_time'}
            , {field:'end_time', minWidth:150, title : '结束时间', sort: true, templet: '#tpl_end_time'}
            , {field: 'status', title: '状态', width: 80, templet: '#tpl_status'}
            , {field: 'high_low', title: '去高去低', width: 120, templet: '#tpl_high_low'}
            , {field: 'is_anonymous', title: '匿名', width: 80, templet: '#tpl_anonymous'}
            , {field: 'can_query', title: '开放查询', width: 120, templet: '#tpl_query'}
            ,{fixed: 'right', minWidth:160, align:'center', toolbar: '#tpl_bar'}
        ]];
    </script>
    <script type="text/html" id="tpl_bar">
        {{ format_optbar(['edit','delete']) }}
        <a href="count/project_id/{{d.id}}" class="layui-btn layui-btn-xs" lay-event="count">计算</a>
        <a href="notice/project_id/{{d.id}}" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="verify">下发通知</a>
    </script>
    <script type="text/html" id="tpl_template">
        {{ format_data_template(d.tpl_id) }}
    </script>
    <script type="text/html" id="tpl_start_time">
        {{ format_timestamp(d.start_time) }}
    </script>
    <script type="text/html" id="tpl_end_time">
        {{ format_timestamp(d.end_time) }}
    </script>
    <script type="text/html" id="tpl_status">
        {{ format_status(d.status) }}
    </script>
    <script type="text/html" id="tpl_high_low">
        {{ format_boolean(d.high_low) }}
    </script>
    <script type="text/html" id="tpl_anonymous">
        {{ format_boolean(d.is_anonymous) }}
    </script>
    <script type="text/html" id="tpl_query">
        {{ format_boolean(d.can_query) }}
    </script>
</block>
<block name="script">
    <script src="/api/Rate/Template/format"></script>
</block>